package com.mallsystem.goodsservice;

import com.mallsystem.common.bean.GoodsPic;
import com.mallsystem.goodsservice.mapper.GoodsPicMapper;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import java.util.ArrayList;

@SpringBootTest
public class MyTest02 {
    @Autowired
    private GoodsPicMapper goodsPicMapper;
    @Test
    public void test1(){
        goodsPicMapper.selectByGoodsId(4)
                .stream()
                .forEach(System.out::println);
    }
    @Test
    public void test2(){
        System.out.println(goodsPicMapper.delete(9999));
    }
    @Test
    public void test3(){
        ArrayList<GoodsPic> list = new ArrayList<>();
        list.add(new GoodsPic(null,"11111",9999));
        list.add(new GoodsPic(null,"11112",9999));
        list.add(new GoodsPic(null,"11113",9999));
        goodsPicMapper.insert(list);
    }
}
